export const MODULE = {
  BANNER: "banner",
};

export const BOOK_NUM = 10;

export const disableStatusOptions = [
  {
    label: "上架",
    value: 1,
  },
  {
    label: "下架",
    value: 0,
  },
];
export const statusOptions = [
  {
    label: "启用",
    value: 1,
  },
  {
    label: "禁用",
    value: 0,
  },
];

export const vipOptions = [
  {
    label: "VIP用户",
    value: 1,
  },
  {
    label: "普通用户",
    value: 0,
  },
];

export const packageTypeOptions = [
  {
    label: "星耀版",
    value: "1",
  },
  {
    label: "星辉版",
    value: "2",
  },
  {
    label: "星链版",
    value: "3",
  },
  {
    label: "星辰版",
    value: "4",
  },
];

export const filterPackageType = (type) => {
  return packageTypeOptions.find((item) => item.value === type)?.label || "-";
};

export function addArgument(fn, newArg) {
  if (fn) {
    return function (...args) {
      console.log("args===", args);
      return fn(...args, newArg);
    };
  }
  return null;
}

export const valuationModelOptions = [
  {
    label: "按件",
    value: 0,
  },
  {
    label: "按重量",
    value: 1,
  },
  {
    label: "按体积",
    value: 2,
  },
];
export const filterValuationModel = (value) => {
  return (
    valuationModelOptions.find((item) => item.value === value)?.label || "-"
  );
};

export const freeOrNoOptions = [
  {
    label: "开启",
    value: 1,
  },
  {
    label: "关闭",
    value: 0,
  },
];

export const filterFreeOrNot = (value) => {
  return freeOrNoOptions.find((item) => item.value === value)?.label || "-";
};
export const articlesCategoryOptions = [
  {
    label: "书籍",
    value: 1,
  },
  {
    label: "周边",
    value: 2,
  },
];
export const paymentTypeOptions = [
  {
    label: "积分",
    value: 1,
  },
  {
    label: "积分+金额",
    value: 2,
  },
];

export const teacherTypeOptions = [
  {
    label: "阅读素养",
    value: 1,
  },
  {
    label: "写作能力",
    value: 2,
  },
];
export const healthTypeOptions = [
  {
    label: "智能穿戴",
    value: 1,
  },
  {
    label: "数字人因测评",
    value: 2,
  },
  {
    label: "中科心研培训认证",
    value: 3,
  },
];
export const freeTypeOptions = [
  {
    label: "免费",
    value: 1,
  },
  {
    label: "收费",
    value: 0,
  },
];

export const orderCategoryOptions = [
  {
    label: "书籍订单",
    value: 1,
  },
  {
    label: "周边订单",
    value: 2,
  },
  {
    label: "积分订单",
    value: 3,
  },
  {
    label: "购物车订单",
    value: 4,
  },
];
export const orderStatusOptions = [
  {
    label: "全部订单",
    value: "0",
  },
  {
    label: "待付款",
    value: "1",
  },
  {
    label: "待发货",
    value: "2",
  },
  {
    label: "运输中",
    value: "8",
  },
  {
    label: "待收货",
    value: "3",
  },
  {
    label: "已完成",
    value: "4",
  },
  {
    label: "已取消",
    value: "5",
  },
  // {
  // 	label: "售后",
  // 	value: '6', // 将6和7合并为一个：售后。后端修改为传6或7都能查出售后中和已售后的订单。
  // },
  {
    label: "售后中",
    value: "6",
  },
  {
    label: "已售后",
    value: "7",
  },
];

export const filterOrderStatusOptions = (val) => {
  if (val == 6 || val == 7) {
    return "售后";
  }
  return orderStatusOptions.find((item) => item.value == val)?.label || "-";
};

export const orderNormalOptions = [
  {
    label: "普通订单",
    value: 0,
  },
  {
    label: "兑换订单",
    value: 1,
  },
];

export const otheOrderStatusOptions = [
  {
    label: "待支付",
    value: "1",
  },
  {
    label: "已支付",
    value: "2",
  },
  {
    label: "已退款",
    value: "3",
  },
  {
    label: "退款中",
    value: "4",
  },
  {
    label: "已取消",
    value: "5",
  },
];

export const filterOtheOrderStatusOptions = (val) => {
  return otheOrderStatusOptions.find((item) => item.value == val)?.label || "-";
};

export const deliveryStatusOptions = [
  {
    label: "待发货",
    value: 1,
  },
  {
    label: "已发货(运输中)",
    value: 2,
  },
  {
    label: "待收货",
    value: 3,
  },
  {
    label: "已收货",
    value: 4,
  },
];
export const filterDeliveryStatusOptions = (val) => {
  return deliveryStatusOptions.find((item) => item.value == val)?.label || "-";
};


export const goodsServiceTypeOptions = [
  {
    label: "退货",
    value: 0,
  },
  {
    label: "换货",
    value: 1,
  },
];

export const refundsStatusOptions = [
  {
    label: "待审批",
    value: 0,
  },
  {
    label: "待寄回",
    value: 1,
  },
  {
    label: "运输中",
    value: 2,
  },
  {
    label: "已完成",
    value: 3,
  },
  {
    label: "已驳回",
    value: 4,
  },
];

export const typeNumOptions = [
  {
    key: "1",
    tab: "单张",
  },
  {
    key: "2",
    tab: "四个",
  },
  {
    key: "3",
    tab: "列表",
  },
];

export const filterRasCode = (val) => {
  return val.split("/").slice(-1)?.[0] || val;
};

export const bannerJumpOptions = [
  {
    value: 1,
    label: "书籍",
  },
  {
    value: 2,
    label: "书包",
  },
  {
    value: 3,
    label: "周边",
  },
  // {
  //   value: 4,
  //   label: "星文旅",
  // },
  {
    value: 5,
    label: "星辅育",
  },
  {
    value: 6,
    label: "星悦会",
  },
  {
    value: 7,
    label: "星健康",
  },
  {
    value: 99,
    label: "自定义图文",
  },
];

export const nameListOptions = [
  {
    value: "文创礼品",
    label: "文创礼品",
  },
  {
    value: "书籍",
    label: "书籍",
  },
];

// 订单状态 1待支付 2已支付 3已退款 4退款中 5已取消 6售后中 7售后退款中 8售后驳回 9售后已退款
export const orderPackageStatusOptions = [
  {
    value: 1,
    label: "待支付",
  },
  {
    value: 2,
    label: "已支付",
  },
  {
    value: 3,
    label: "已退款",
  },
  {
    value: 4,
    label: "退款中",
  },
  {
    value: 5,
    label: "已取消",
  },
  {
		label: "售后中",
		value: '6',
	},
	{
		label: "售后退款中",
		value: '7',
	},
	{
		label: "售后驳回",
		value: '8',
	},
	{
		label: "售后已退款",
		value: '9',
	},
];

export const filterOrderPackageStatusOptions = (val) => {
  return (
    orderPackageStatusOptions.find((item) => item.value == val)?.label || "-"
  );
};

// 服务状态 0待发货(商家) 1已发货(商家) 2已收货 (用户) 3已发货(用户)  4已收货(商家)
export const schoolbagStatusOptions = [
  {
    value: 0,
    label: "待发货(商家)",
  },
  {
    value: 1,
    label: "已发货(商家)",
  },
  {
    value: 2,
    label: "已收货(用户)",
  },
  {
    value: 3,
    label: "已发货(用户)",
  },
  {
    value: 4,
    label: "已收货(商家)",
  },
];

export const filterSchoolbagStatusOptions = (val) => {
  return schoolbagStatusOptions.find((item) => item.value == val)?.label || "-";
};
